<?php

abstract class Kd_Data_Dcl_Parser_Base {

    public function __construct() {}

    public function parse(Kd_Data_Dcl_Base $dcl){
        if($dcl instanceof Kd_Data_Dcl_Query){
            return $this->parseQuery($dcl);
        }elseif($dcl instanceof Kd_Data_Dcl_Update){
            return $this->parseUpdate($dcl);
        }elseif($dcl instanceof Kd_Data_Dcl_Insert){
            return $this->parseInsert($dcl);
        }elseif($dcl instanceof Kd_Data_Dcl_Delete){
            return $this->parseDelete($dcl);
        }
    }

    protected abstract function parseQuery(Kd_Data_Dcl_Query $query);

    protected abstract function parseInsert(Kd_Data_Dcl_Insert $insert);

    protected abstract function parseUpdate(Kd_Data_Dcl_Update $update);

    protected abstract function parseDelete(Kd_Data_Dcl_Delete $delete);
}